home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_perl.idb / usr / freeware / catman / p_man / cat3 / User::grent.Z / User::grent
Encoding:
Text File  |  1998-10-28  |  3.1 KB  |  133 lines

  1.  
  2.  
  3.  
  4.      UUUUsssseeeerrrr::::::::ggggrrrreeeennnntttt((((3333))))  22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222))))    UUUUsssseeeerrrr::::::::ggggrrrreeeennnntttt((((3333))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.       User::grent -    by-name    interface to Perl's built-in getgr*()
  10.       functions
  11.  
  12.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.        use User::grent;
  14.        $gr = getgrgid(0) or    die "No    group zero";
  15.        if (    $gr->name eq 'wheel' &&    @{$gr->members}    > 1 ) {
  16.            print "gid zero name wheel, with    other members";
  17.        }
  18.  
  19.        use User::grent qw(:FIELDS;
  20.        getgrgid(0) or die "No group    zero";
  21.        if (    $gr_name eq 'wheel' && @gr_members > 1 ) {
  22.            print "gid zero name wheel, with    other members";
  23.        }
  24.  
  25.        $gr = getgr($whoever);
  26.  
  27.  
  28.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  29.       This module's    default    exports    override the core _g_e_t_g_r_e_n_t(),
  30.       _g_e_t_g_r_u_i_d(), and _g_e_t_g_r_n_a_m() functions,    replacing them with
  31.       versions that    return "User::grent" objects.  This object has
  32.       methods that return the similarly named structure field name
  33.       from the C's passwd structure    from _g_r_p._h; namely name,
  34.       passwd, gid, and members (not    mem).  The first three return
  35.       scalars, the last an array reference.
  36.  
  37.       You may also import all the structure    fields directly    into
  38.       your namespace as regular variables using the    :FIELDS    import
  39.       tag.    (Note that this    still overrides    your core functions.)
  40.       Access these fields as variables named with a    preceding gr_.
  41.       Thus,    $group_obj->gid() corresponds to $gr_gid if you    import
  42.       the fields.  Array references    are available as regular array
  43.       variables, so    @{ $group_obj->members() } would be simply
  44.       @gr_members.
  45.  
  46.       The _g_e_t_p_w() funtion is a simple front-end that forwards a
  47.       numeric argument to _g_e_t_p_w_u_i_d() and the rest to _g_e_t_p_w_n_a_m().
  48.  
  49.       To access this functionality without the core    overrides,
  50.       pass the use an empty    import list, and then access function
  51.       functions with their full qualified names.  On the other
  52.       hand,    the built-ins are still    available via the CORE::
  53.       pseudo-package.
  54.  
  55.      NNNNOOOOTTTTEEEE
  56.       While    this class is currently    implemented using the
  57.       Class::Struct    module to build    a struct-like class, you
  58.       shouldn't rely upon this.
  59.  
  60.  
  61.  
  62.  
  63.      Page 1                        (printed 10/23/98)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      UUUUsssseeeerrrr::::::::ggggrrrreeeennnntttt((((3333))))  22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222))))    UUUUsssseeeerrrr::::::::ggggrrrreeeennnntttt((((3333))))
  71.  
  72.  
  73.  
  74.      AAAAUUUUTTTTHHHHOOOORRRR
  75.       Tom Christiansen
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.      Page 2                        (printed 10/23/98)
  130.  
  131.  
  132.  
  133.